package com.colorful.insuranceproject.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.lovely3x.jsonparser.annotations.JSONObject;

/**
 * Created by handsome-Bob on 2017/8/23.
 * <p>
 * 个人中心
 */
public class PersonInfoBean implements Parcelable {

    @JSONObject(object = PersonInfo.class, value = "personInfo")
    private PersonInfo personInfo;

    @JSONObject(object = CompanyInfo.class, value = "companyInfo")
    private CompanyInfo companyInfo;

    @JSONObject(object = MoneyInfo.class, value = "moneyInfo")
    private MoneyInfo moneyInfo;

    @JSONObject(object = BankInfo.class, value = "bindBank")
    private BankInfo bindBank;

    private int isAuth;

    private String userPhone;

    private int hasBankCard;

    private int hasUserAddress;

    public PersonInfoBean() {
    }

    public PersonInfoBean(PersonInfo personInfo, CompanyInfo companyInfo, MoneyInfo moneyInfo, BankInfo bindBank, int isAuth, String userPhone, int hasBankCard, int hasUserAddress) {
        this.personInfo = personInfo;
        this.companyInfo = companyInfo;
        this.moneyInfo = moneyInfo;
        this.bindBank = bindBank;
        this.isAuth = isAuth;
        this.userPhone = userPhone;
        this.hasBankCard = hasBankCard;
        this.hasUserAddress = hasUserAddress;
    }

    public PersonInfo getPersonInfo() {
        return personInfo;
    }

    public void setPersonInfo(PersonInfo personInfo) {
        this.personInfo = personInfo;
    }

    public CompanyInfo getCompanyInfo() {
        return companyInfo;
    }

    public void setCompanyInfo(CompanyInfo companyInfo) {
        this.companyInfo = companyInfo;
    }

    public MoneyInfo getMoneyInfo() {
        return moneyInfo;
    }

    public void setMoneyInfo(MoneyInfo moneyInfo) {
        this.moneyInfo = moneyInfo;
    }

    public BankInfo getBindBank() {
        return bindBank;
    }

    public void setBindBank(BankInfo bindBank) {
        this.bindBank = bindBank;
    }

    public int getIsAuth() {
        return isAuth;
    }

    public void setIsAuth(int isAuth) {
        this.isAuth = isAuth;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public int getHasBankCard() {
        return hasBankCard;
    }

    public void setHasBankCard(int hasBankCard) {
        this.hasBankCard = hasBankCard;
    }

    public int getHasUserAddress() {
        return hasUserAddress;
    }

    public void setHasUserAddress(int hasUserAddress) {
        this.hasUserAddress = hasUserAddress;
    }

    @Override
    public String toString() {
        return "PersonInfoBean{" +
                "personInfo=" + personInfo +
                ", companyInfo=" + companyInfo +
                ", moneyInfo=" + moneyInfo +
                ", bindBank=" + bindBank +
                ", isAuth=" + isAuth +
                ", userPhone='" + userPhone + '\'' +
                ", hasBankCard=" + hasBankCard +
                ", hasUserAddress=" + hasUserAddress +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.personInfo, flags);
        dest.writeParcelable(this.companyInfo, flags);
        dest.writeParcelable(this.moneyInfo, flags);
        dest.writeParcelable(this.bindBank, flags);
        dest.writeInt(this.isAuth);
        dest.writeString(this.userPhone);
        dest.writeInt(this.hasBankCard);
        dest.writeInt(this.hasUserAddress);
    }

    protected PersonInfoBean(Parcel in) {
        this.personInfo = in.readParcelable(PersonInfo.class.getClassLoader());
        this.companyInfo = in.readParcelable(CompanyInfo.class.getClassLoader());
        this.moneyInfo = in.readParcelable(MoneyInfo.class.getClassLoader());
        this.bindBank = in.readParcelable(BankInfo.class.getClassLoader());
        this.isAuth = in.readInt();
        this.userPhone = in.readString();
        this.hasBankCard = in.readInt();
        this.hasUserAddress = in.readInt();
    }

    public static final Creator<PersonInfoBean> CREATOR = new Creator<PersonInfoBean>() {
        @Override
        public PersonInfoBean createFromParcel(Parcel source) {
            return new PersonInfoBean(source);
        }

        @Override
        public PersonInfoBean[] newArray(int size) {
            return new PersonInfoBean[size];
        }
    };
}
